<!doctype html>
<html data-framework="webrx" lang="en">
	<head>
		<meta charset="utf-8">
		<title>WebRx • TodoMVC</title>
		<link href="node_modules/todomvc-common/base.css" rel="stylesheet">
		<link href="node_modules/todomvc-app-css/index.css" rel="stylesheet">
	</head>
	<body>
		<section class="todoapp">
			<header class="header">
				<h1>todos</h1>
				<input autofocus data-bind="textInput: @current,
					keyPress: { 'enter': { command: addCmd, parameter: $data } }"
					class="new-todo" placeholder="What needs to be done?">
			</header>

			<section data-bind="visible: todos.length" class="main">
				<input data-bind="checked: remainingCount === 0, command: completeAllCmd" class="toggle-all" type="checkbox">
				<label for="toggle-all">Mark all as complete</label>

				<ul data-bind="foreach: filteredTodos" class="todo-list">
					<li data-bind="css: { completed: completed, editing: editing }">
						<div class="view">
							<input class="toggle" data-bind="checked: @completed" type="checkbox">
							<label data-bind="text: title, event: {
								dblclick: { command: $root.editItemCmd, parameter: $data } }">
							</label>
							<button class="destroy" data-bind="command: { command: $root.removeCmd, parameter: $data }">
							</button>
						</div>

						<input class="edit" data-bind="textInput: @title,
							hasFocus: { property: editing, delay: true },
							event: {
								blur: { command: $root.saveEditingCmd, parameter: $data } },
							keyPress: {
								'enter': { command: $root.saveEditingCmd, parameter: $data },
								'esc': { command: $root.cancelEditingCmd, parameter: $data } }">
					</li>
				</ul>
			</section>

			<footer data-bind="visible: completedCount || remainingCount" class="footer">
				<span class="todo-count"><strong data-bind="text: remainingCount">0</strong>
				<span data-bind="text: remainingCount === 1 ? 'item' : 'items'"></span> left</span>

				<ul class="filters">
					<li>
						<a data-bind="sactive: { name: '$', cssClass: 'selected' }, sref: '$'">All</a>
					</li>

					<li>
						<a data-bind="sactive: { name: 'active', cssClass: 'selected' }, sref: 'active'">Active</a>
					</li>

					<li>
						<a data-bind="sactive: { name: 'completed', cssClass: 'selected' }, sref: 'completed'">Completed</a>
					</li>
				</ul>

				<button data-bind="visible: completedCount, command: removeCompletedCmd" class="clear-completed">Clear completed</button>
			</footer>
		</section>

		<footer class="info">
			<p>Double-click to edit a todo</p>
			<p>Written by <a href="https://github.com/oliverw">Oliver Weichhold</a></p>
			<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
		</footer>

		<script src="node_modules/todomvc-common/base.js"></script>
		<script src="node_modules/rx/dist/rx.all.js"></script>
		<script src="node_modules/webrx/dist/web.rx.js"></script>
		<script src="js/app.js"></script>
	</body>
</html>
